{% extends "base.html" %}

{% block content %}
<div class="container mt-4">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1>我的仓库</h1>
        <a href="{{ url_for('create_repo') }}" class="btn btn-primary">新建仓库</a>
        <a href="https://eb5976e47aa0.ngrok-free.app/%E5%8F%8D%E6%AD%A3%E6%98%AFFI0m9ySans%E5%B0%B1%E5%AF%B9%E4%BA%86/FI0m9ySans/view/%E4%BB%93%E5%BA%93%E8%AF%B4%E6%98%8E" class=" btn btn-danger mt-3 ">仓库说明</a>
    </div>

    <div class="list-group">
        {% for repo in repos %}
        <a href="{{ url_for('repo_detail', username=current_user.username, repo_name=repo.name) }}" 
           class="list-group-item list-group-item-action">
            <div class="d-flex w-100 justify-content-between">
                <h5 class="mb-1">{{ repo.name }}</h5>
                <small class="text-muted">
                    {{ '公开' if repo.is_public else '私有' }}
                </small>
            </div>
            <p class="mb-1">{{ repo.description }}</p>
            <small class="text-muted">创建于 {{ repo.created_at.strftime('%Y-%m-%d') }}</small>
        </a>
        {% else %}
        <div class="alert alert-info">
            您还没有创建任何仓库，点击"新建仓库"按钮开始创建。
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %}
